package com.linxz.video.videoplayer.view;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import android.text.TextUtils;
import android.widget.RelativeLayout;
import android.widget.Toast;

import com.linxz.video.R;
import com.linxz.video.videoplayer.VideoAdContext;
/**
 * @author Linxz
 * 创建日期：2019年10月16日 11:21
 * version：v4.5.4
 * 描述：
 */
public class VideoFullActivity extends AppCompatActivity {

    private RelativeLayout videoContent;
    private String path;

    public static void launch(Context context, String path){
        Intent intent=new Intent(context,VideoFullActivity.class);
        intent.putExtra("sourcePath",path);
        context.startActivity(intent);
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.lib_video_act_video_full);
        videoContent=findViewById(R.id.videoContent);
        path=getIntent().getStringExtra("sourcePath");
        if (TextUtils.isEmpty(path)){
            Toast.makeText(VideoFullActivity.this,"文件路径无效",Toast.LENGTH_SHORT).show();
            finish();
            return;
        }
        VideoAdContext videoAdContext=new VideoAdContext(videoContent,path);
        videoAdContext.mute(false);

    }
}
